package com.smag.echarts.service.impl;

import java.util.List;
import com.smag.common.utils.DateUtils;
import com.smag.echarts.domain.EchartsLineArea;
import com.smag.echarts.domain.vo.EchartsMapVo;
import com.smag.echarts.mapper.EchartsLineAreaMapper;
import com.smag.echarts.service.IEchartsLineAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 农作物种植面积Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-26
 */
@Service
public class EchartsLineAreaServiceImpl implements IEchartsLineAreaService
{
    @Autowired
    private EchartsLineAreaMapper echartsLineAreaMapper;

    /**
     * 查询农作物种植面积
     * 
     * @param id 农作物种植面积主键
     * @return 农作物种植面积
     */
    @Override
    public EchartsLineArea selectEchartsLineAreaById(Long id)
    {
        return echartsLineAreaMapper.selectEchartsLineAreaById(id);
    }

    /**
     * 查询农作物种植面积列表
     * 
     * @param echartsLineArea 农作物种植面积
     * @return 农作物种植面积
     */
    @Override
    public List<EchartsLineArea> selectEchartsLineAreaList(EchartsLineArea echartsLineArea)
    {
        return echartsLineAreaMapper.selectEchartsLineAreaList(echartsLineArea);
    }

    /**
     * 新增农作物种植面积
     * 
     * @param echartsLineArea 农作物种植面积
     * @return 结果
     */
    @Override
    public int insertEchartsLineArea(EchartsLineArea echartsLineArea)
    {
        echartsLineArea.setCreateTime(DateUtils.getNowDate());
        return echartsLineAreaMapper.insertEchartsLineArea(echartsLineArea);
    }

    /**
     * 修改农作物种植面积
     * 
     * @param echartsLineArea 农作物种植面积
     * @return 结果
     */
    @Override
    public int updateEchartsLineArea(EchartsLineArea echartsLineArea)
    {
        echartsLineArea.setUpdateTime(DateUtils.getNowDate());
        return echartsLineAreaMapper.updateEchartsLineArea(echartsLineArea);
    }

    /**
     * 批量删除农作物种植面积
     * 
     * @param ids 需要删除的农作物种植面积主键
     * @return 结果
     */
    @Override
    public int deleteEchartsLineAreaByIds(Long[] ids)
    {
        return echartsLineAreaMapper.deleteEchartsLineAreaByIds(ids);
    }

    /**
     * 删除农作物种植面积信息
     * 
     * @param id 农作物种植面积主键
     * @return 结果
     */
    @Override
    public int deleteEchartsLineAreaById(Long id)
    {
        return echartsLineAreaMapper.deleteEchartsLineAreaById(id);
    }

    @Override
    public List<EchartsMapVo> firstList() {
        List<EchartsMapVo> vo = echartsLineAreaMapper.firstList();
        return vo;
    }
}
